# http://www.bjhospital.net/
# 用例1：
# 搜索骨科—>点击搜索—>点击出来的第一个链接—>断言文本内容

import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Chrome()
driver.get("http://www.bjhospital.net/")
driver.maximize_window()
time.sleep(2)
driver.find_element(By.CLASS_NAME,"keyword").send_keys("骨科")
time.sleep(2)
driver.find_element(By.CLASS_NAME,"btn").click()
time.sleep(2)
driver.find_element(By.XPATH,"//*[text()='毕节市第一人民医院高值医用耗材网上阳光平台议价意向公开']").click()
time.sleep(2)
win = driver.window_handles
driver.switch_to.window(win[-1])
text = driver.find_element(By.XPATH,"/html/body/div[2]/div/div/a[2]").text   #直接复制就行
assert text =="通知公告"




